// 默认访问的路由
export const defaultRoutes = [
  {
    path: "/",
    redirect: {
      path: "/product/productmanage"
    },
    meta: {
      title: "内容管理",
      requiresAuth: true,
      requiresRole: {}
    }
  },
  {
    path: "/product/create",
    redirect: {
      path: "/product/createProduct"
    },
    meta: {
      title: "新增产品"
    }
  },
  {
    path: "/product",
    component: () => import("@/views/product-manage/product.vue"),
    children: [
      {
        path: "productmanage",
        name: "productmanage",
        component: () => import("@/views/product-manage/product-manage.vue"),
        meta: {
          requiresAuth: true,
          title: "产品管理",
          isSub: true
        }
      },
      {
        path: "productattribute",
        name: "productattribute",
        component: () => import("@/views/product-manage/product-attribute.vue"),
        meta: {
          requiresAuth: true,
          title: "属性管理",
          isSub: true
        }
      },
      {
        path: "createProduct",
        name: "createProduct",
        component: () => import("@/components/ProductManage/ContentDetail.vue"),
        meta: {
          requiresAuth: false,
          title: "新增产品",
          isSub: true
        }
      },
    ]
  },


  {
    path: "/channel",
    component: () => import("@/views/channel-manage/channel.vue"),
    children: [
      {
        path: "channelmanage",
        name: "channelmanage",
        component: () => import("@/views/channel-manage/channel-manage.vue"),
        meta: {
          requiresAuth: true,
          title: "渠道管理",
          isSub: true
        }
      },
      {
        path: "channelproduct",
        name: "channelproduct",
        component: () => import("@/views/channel-manage/channel-product.vue"),
        meta: {
          requiresAuth: true,
          title: "渠道产品",
          isSub: true
        }
      },
      {
        path: "channelproductLevel",
        name: "channelproductLevel",
        component: () => import("@/views/channel-manage/channel-product-level.vue"),
        meta: {
          requiresAuth: true,
          title: "管理员渠道",
          isSub: true
        }
      },
    ]
  },
  {
    path: "/order",
    component: () => import("@/views/order-manage/order.vue"),
    children: [
      {
        path: "ordermanage",
        name: "ordermanage",
        component: () => import("@/views/order-manage/order-manage.vue"),
        meta: {
          requiresAuth: true,
          title: "订单管理",
          isSub: true
        }
      },
      {
        path: "orderlevel",
        name: "orderlevel",
        component: () => import("@/views/order-manage/order-level.vue"),
        meta: {
          requiresAuth: true,
          title: "订单管理员",
          isSub: true
        }
      },
    ]
  },
  {
    path: "/user",
    component: () => import("@/views/user-manage/user.vue"),
    children: [
      {
        path: "usermanage",
        name: "usermanage",
        component: () => import("@/views/user-manage/user-manage.vue"),
        meta: {
          requiresAuth: true,
          title: "用户管理",
          isSub: true
        }
      },
    ]
  },
  {
    path: "/business",
    component: () => import("@/views/business-manage/business.vue"),
    children: [
      {
        path: "businessmanage",
        name: "businessmanage",
        component: () => import("@/views/business-manage/business-manage.vue"),
        meta: {
          requiresAuth: true,
          title: "业务管理",
          isSub: true
        }
      },
      {
        path: "businesslevel",
        name: "businesslevel",
        component: () => import("@/views/business-manage/business-level.vue"),
        meta: {
          requiresAuth: true,
          title: "业务管理员",
          isSub: true
        }
      },
      {
        path: "businessdetails",
        name: "businessdetails",
        component: () => import("@/views/business-manage/business-details.vue"),
        meta: {
          requiresAuth: false,
          title: "业务详情",
          isSub: true
        }
      },
    ]
  },
  {
    path: "/personal",
    name: "personal",
    component: () => import("@/views/personal.vue"),
    meta: {
      title: "个人中心",
      requiresAuth: false,
      requiresRole: {}
    }
  },
  {
    path: "/callback",
    name: "callback",
    component: () => import("@/views/login/signcallback.vue"),
    meta: {
      title: "微站",
      requiresAuth: true
    }
  },
  {
    path: "/signout-callback-oidc",
    name: "signout-callback-oidc",
    component: () => import("@/views/login/signout-callback-oidc.vue"),
    meta: {
      title: "callback"
    }
  },
  {
    path: "/401",
    component: () => import("@/views/error-page/401.vue"),
    name: "401"
  },
  {
    path: "/404",
    component: () => import("@/views/error-page/404.vue"),
    name: "404"
  },
  {
    path: "/403",
    component: () => import("@/views/error-page/403.vue"),
    name: "403"
  },
  {
    path: "/500",
    component: () => import("@/views/error-page/500.vue"),
    name: "500",
    meta: {
      title: "服务器错误",
      isSub: false
    }
  },
  {
    path: "*",
    redirect: {
      path: "/product/productmanage"
    },
    meta: {
      title: "内容管理",
      requiresAuth: true,
      requiresRole: {}
    }
  }
];
